package com.crm.mapper;

import com.crm.aonnation.AutoFill;
import com.crm.dto.CourseDto;

import com.crm.pojo.Course;
import com.crm.enumeration.OperationType;

import com.crm.vo.CourseVo;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface CourseMapper {
    //分页查询
    Page<CourseVo> getCourse(CourseDto dto);

    @Select("select * from course ")
    List<Course> queryList();

    /**
     * 新增课程
     *
     * @param course
     */
    @AutoFill(OperationType.INSERT)
    void addCourse(Course course);

    @Delete("delete from course where id=#{id}")
    void deleteCourse(Integer id);

@Select("select * from course where id =#{id} ")
    Course queryById(Integer id);
@AutoFill(OperationType.UPDATE)
    void updateCourse(Course course);
}
